<!--# layout("/common/layout.html",{"jsBase":"/js/system/cfgThirdRecord/"}){ -->

<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">账号类型</label>
				<div class="layui-input-inline">
					<layui:simpleDictSelect style='layui-input-inline' type="PAY_PLATFORM_TYPE" layVerify="required"
								id="platformType" name="platformType" value="" />
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">unid</label>
				<div class="layui-input-inline">
                                <input type="text" name="unid" id="unid" autocomplete="off" class="layui-input" lay-verify="required">
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">配置json</label>
				<div class="layui-input-inline">
                                <input type="text" name="configJson" id="configJson" autocomplete="off" class="layui-input" lay-verify="required">
				</div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">备注</label>
				<div class="layui-input-inline">
                                <input type="text" name="configMemo" id="configMemo" autocomplete="off" class="layui-input" >
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">createTime</label>
				<div class="layui-input-inline">
                                <input type="text" name="createTime" id="createTime" autocomplete="off" class="layui-input" >
				</div>
            </div>
        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.define([ 'form', 'laydate', 'table','cfgThirdRecordApi'], function(exports) {
    var form = layui.form;
    var cfgThirdRecordApi = layui.cfgThirdRecordApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(cfgThirdRecordJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                form.on('submit(form)', function(){
                    cfgThirdRecordApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(cfgThirdRecordJson))){  -->
    var formJson = ${cfgThirdRecordJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
